# Replication

* This folder contains full replication data for ``Audits of the 2020 American Election Show an Accurate Vote Count'', by Baltz, Gonzalez, Guo, Jaffe, and Stewart III in the *Proceedings of the National Academy of Sciences*. 

* The `state_data` folder contains the state by state audit data. Each state's folder contains original data, cleaned data, any scripts that were used to perform that cleaning, and a separate README file identifying the source of the original data and explaining the folder's layout.

* The `src` folder contains code that merges together the cleaned state-by-state files, and code that produces all of the analysis in the article and supplementary materials. That code writes logs and final datasets to the `data_for_analysis` folder, and it writes the paper's figures to the `figures` folder.

* In order to fully replicate our analysis, 
	1. Access a state's folder, consult the README, and independently perform the process that generated the data in that state's `ready` folder. Wherever possible this is facilitated by the inclusion of state-specific replication code, though in many cases the cleaned data could only be generated manually. The dataset regarding total number of ballots was assembled manually.
	2. Run the script `merge_and_standardize.py` in the `src` folder to combine the state-by-state cleaned data into one dataset for analysis, `all_audits.csv` in `data_for_analysis`.
	3. Run the script `analysis.r` in the `src` folder to perform the analysis on `all_audits.csv`, which will generate in-text claims to `analysis_log.txt` in `data_for_analysis` and the paper's figures in the `figures` folder. The results presented in `analysis_log.txt` are intended to match the order in which those results are cited in the article.

Please direct any questions to Samuel Baltz at sbaltz@umich.edu.
